home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / include / user / sig.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-10  |  4.8 KB  |  172 lines

  1. /*
  2.  * sig.h --
  3.  *
  4.  *     Data structures and used by the signal module for user system
  5.  *     calls.
  6.  *
  7.  * Copyright (C) 1985, 1988 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  *
  16.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/sig.h,v 1.2 92/02/28 19:55:54 kupfer Exp $ SPRITE (Berkeley)
  17.  */
  18.  
  19. #ifndef _SIGUSER
  20. #define _SIGUSER
  21.  
  22. #ifndef _MiG
  23. #include <cfuncproto.h>
  24. #ifdef SPRITED
  25. #include <sigTypes.h>
  26. #else
  27. #include <sprited/sigTypes.h>
  28. #endif
  29. #endif
  30.  
  31. /*
  32.  * The different actions for signals.
  33.  * SIG_IGNORE_ACTION    Ignore the signal.
  34.  * SIG_KILL_ACTION    Kill the process.
  35.  * SIG_DEBUG_ACTION    Enter the debugger for the process.
  36.  * SIG_DEFAULT_ACTION    Take the default action.
  37.  * SIG_HANDLE_ACTION    Call a signal handler for the process.
  38.  * SIG_MIGRATE_ACTION    Migrate the process to another node.  The node
  39.  *                must have already been set.
  40.  * SIG_SUSPEND_ACTION    Suspend execution of the process.
  41.  */
  42. #define    SIG_IGNORE_ACTION    0
  43. #define    SIG_KILL_ACTION        1
  44. #define    SIG_DEBUG_ACTION    2
  45. #define    SIG_DEFAULT_ACTION    3
  46. #define    SIG_HANDLE_ACTION    4
  47. #define    SIG_MIGRATE_ACTION    5
  48. #define    SIG_SUSPEND_ACTION    6
  49.  
  50. #define    SIG_NUM_ACTIONS        7
  51.  
  52. /* sizeof(Sig_Action)/sizeof(int), for use by MIG. */
  53. #define SIG_ACTION_SIZE        3
  54.  
  55. #ifndef _MiG
  56.  
  57. /* 
  58.  * The type of a Sprite signal handler.
  59.  * XXX Should Sig_Context be the same as struct sigcontext?
  60.  */
  61.  
  62. typedef int (*Sig_HandleProc)_ARGS_((int spriteSig, int spriteCode,
  63.         Sig_Context *sigContextPtr, Address sigAddr));
  64.  
  65. /*
  66.  * The structure to use to specify the action to take for a signal.
  67.  */
  68. typedef    struct {
  69.     int        action;
  70.     Sig_HandleProc handler;    /* ptr to signal handler */
  71.     int        sigHoldMask;
  72. } Sig_Action;
  73.  
  74. #endif /* _MiG */
  75.  
  76. /*
  77.  * The different signals.
  78.  *
  79.  * SIG_DEBUG        Enter the debugger.
  80.  * SIG_ARITH_FAULT    Arithmetic instruction fault (e.g., division by zero).
  81.  * SIG_ILL_INST        Illegal instruction.
  82.  * SIG_ADDR_FAULT    Bad operand address.
  83.  * SIG_KILL        Kill the process.
  84.  * SIG_INTERRUPT    Interrupt the process.
  85.  * SIG_BREAKPOINT    A breakpoint trap exception.
  86.  * SIG_TRACE_TRAP    A trace trap exception.
  87.  * SIG_MIGRATE_TRAP    A migration trap exception (privileged).
  88.  * SIG_MIGRATE_HOME    Signal a process to return home after migration.
  89.  * SIG_SUSPEND        Suspend execution.
  90.  * SIG_RESUME        Resume execution after being suspended.
  91.  * SIG_TTY_INPUT    Signal to a background process that tries to read
  92.  *            from the tty.
  93.  * SIG_PIPE        The reader of a pipe has died.
  94.  * SIG_TIMER        An timer set with Proc_SetIntTimer has expired.
  95.  * SIG_URGENT        Urgent condition (i.e., out-of-band data) is present 
  96.  *            on a socket
  97.  * SIG_CHILD        A child's status has changed.
  98.  * SIG_TERM        Software termination.
  99.  * SIG_TTY_SUSPEND    Suspend signal from keyboard.
  100.  * SIG_TTY_OUTPUT    Signal to a background process that tries to write
  101.  *            to the tty when that has been dis-allowed.
  102.  */
  103. #define    SIG_DEBUG        1
  104. #define    SIG_ARITH_FAULT        2
  105. #define    SIG_ILL_INST        3
  106. #define    SIG_ADDR_FAULT        4
  107. #define    SIG_KILL        5
  108. #define    SIG_INTERRUPT        6
  109. #define    SIG_BREAKPOINT        7
  110. #define    SIG_TRACE_TRAP        8
  111. #define    SIG_MIGRATE_TRAP     9
  112. #define    SIG_MIGRATE_HOME     10
  113. #define    SIG_SUSPEND        11
  114. #define    SIG_RESUME        12
  115. #define    SIG_TTY_INPUT        13
  116. #define SIG_PIPE        14
  117. #define SIG_TIMER        15
  118. #define SIG_URGENT        16
  119. #define SIG_CHILD        17
  120. #define SIG_TERM        18
  121. #define    SIG_TTY_SUSPEND        19
  122. #define SIG_TTY_OUTPUT        20
  123.  
  124. /*
  125.  * Define the bounds on signals.
  126.  *
  127.  * SIG_MIN_SIGNAL            The smallest valid signal.
  128.  * SIG_LAST_RESERVED_SIGNAL        All signals after this one can be user
  129.  *                    defined.
  130.  * SIG_NUM_SIGNALS            The total number of signals.
  131.  */
  132. #define    SIG_MIN_SIGNAL            1
  133. #define    SIG_LAST_RESERVED_SIGNAL    SIG_TTY_OUTPUT
  134. #define    SIG_NUM_SIGNALS            32
  135.  
  136. /*
  137.  * A code of zero indicates that there is no code for the signal.
  138.  */
  139. #define    SIG_NO_CODE        -1
  140.  
  141. /*
  142.  * The different standard codes for an illegal instruction signal
  143.  *
  144.  * SIG_ILL_INST_CODE    This was actually an illegal instruction.
  145.  * SIG_BAD_SYS_CALL    A bad system call number was passed to a system call
  146.  *            trap.
  147.  * SIG_BAD_TRAP        An illegal trap instruction was executed.
  148.  * SIG_PRIV_INST    A privledged instruction was executed.
  149.  */
  150. #define    SIG_ILL_INST_CODE    0
  151. #define    SIG_BAD_SYS_CALL    1
  152. #define    SIG_BAD_TRAP        2
  153. #define    SIG_PRIV_INST        3
  154.  
  155. /*
  156.  * The different standard codes for an address fault.
  157.  *
  158.  * SIG_ACCESS_VIOL    The address accesses a protected area of memory.
  159.  * SIG_ADDR_ERROR     The operand address is on an improper boundary.
  160.  */
  161. #define    SIG_ACCESS_VIOL        0
  162. #define    SIG_ADDR_ERROR        1
  163.  
  164. /*
  165.  * The standard codes for an arithmetic fault.
  166.  *
  167.  * SIG_ZERO_DIV        Division by zero.
  168.  */
  169. #define    SIG_ZERO_DIV        0
  170.  
  171. #endif /* _SIGUSER */
  172.